package d01007;

public class AnimalTest {
    public static void main(String[] args){
        Animal animal=new Animal();

        System.out.println(animal.getInfo());
        animal.setAname("哈士奇");
        animal.setWeight(10.0);
        System.out.println(animal.getInfo());
        double weight=animal.getWeight();
        System.out.println(weight);

        Animal animal2=new Animal();
        animal.setAname("泰迪");
        System.out.println(animal2);
        //调用带一个参数对外构造函数创建对象
        Animal animal3=new Animal("牧羊犬");
        animal3.setWeight(12);
        System.out.println(animal3.getInfo());
        //调用带两个参数的构造函数创建对象
        Animal animal4=new Animal("中华田园犬",12);
        System.out.println(animal4.getInfo());
    }
}
